cmake_minimum_required(VERSION 3.5)
add_subdirectory(raycast)
project(kinect)
# add_definitions(-w)
# ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
set (CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS}  -lasan -lstdc++ ")

find_package(CUDA REQUIRED)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-lasan ;-std=c++11 ;-O3;-w;-gencode arch=compute_61,code=sm_61;-Xcudafe "--diag_suppress=boolean_controlling_expr_is_constant")#;-G;-g$
# set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};--std=c++11;-O3;-w)
# list(APPEND CUDA_NVCC_FLAGS "-gencode;arch=compute_61,code=sm_61")
# list(APPEND CUDA_NVCC_FLAGS "-Xcompiler;-fPIC;")
# set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ";-std=c++11 ;-w;--ftz=true;--prec-div=false;--prec-sqrt=false")
find_package(OpenCV REQUIRED)
find_package(Eigen3 REQUIRED)

include_directories(
	${EIGEN3_INCLUDE_DIRS}
	${OpenCV_INCLUDE_DIRS}
)

file(GLOB SRC ./*.cu*)
file(GLOB SRC_CPP ./*.cc)

# add_library(ut ${SRC_CPP})
# utils/loguru.cpp
cuda_add_library(kin  ${SRC}  ${SRC_CPP})

target_link_libraries(kin   
${OpenCV_LIBS}
${CUDA_LIBS}
${CMAKE_DL_LIBS} -lpthread 
raycast
) 

cuda_add_executable(kinapp kinapp.cc)
target_link_libraries(kinapp kin ${CUDA_LIBS} raycast)
# add_executable(main main.cc loguru.cpp)
# target_link_libraries(main 	asan -lstdc++   ${CMAKE_DL_LIBS} -lpthread)


# cuda_add_executable(test test.cu  
# )
# target_link_libraries(test   
# # ${OpenCV_LIBS}
# ${CUDA_LIBS}
# ) 
